import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../components/Index";
import DeptManager from "../components/DeptManager";
import AddDept from "../components/AddDept";
import DeptUpdate from "../components/DeptUpdate";
import AddDept1 from "../components/AddDept1";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: '啦啦',
    component: Index, //首页
    redirect: 'DeptManager', //首次访问时展示页面一的内容
    children: [       //子菜单
      {
        path: '/DeptManager',
        name: '部门管理',
        component: DeptManager
      },
      {
        path: '/AddDept',
        name: '添加部门',
        component: AddDept
      },
      {
        path:'/update',
        name: '更新部门',
        component:DeptUpdate
      },
      {
        path: '/AddDept1',
        name: '添加其他',
        component: AddDept1
      }
    ]

  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
